package com.mapper;

import com.pojo.CClass;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
* @author fujiaqing
* @description 针对表【c_class】的数据库操作Mapper
* @createDate 2024-11-19 15:28:53
* @Entity com.pojo.CClass
*/
public interface CClassMapper {

    int deleteByPrimaryKey(Long id);

    int insert(CClass record);

    int insertSelective(CClass record);

    CClass selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CClass record);

    int updateByPrimaryKey(CClass record);

    @Select("select * from c_class where id = #{id}")
    @Results({
            @Result(id = true, column = "id",property = "id"),
            @Result(column = "classname",property = "classname"),
            @Result(column = "id",property = "studentsList",
                    many = @Many(select = "com.mapper.StudentsMapper.selectStudentsByUserId"))
    })
    CClass selectCClassById(int id);
}

